<template>
    <div>
        <van-nav-bar title="商品列表" left-text="返回" left-arrow @click-left="onClickLeft" />
        <div v-for="item in goodsApiData">
            <router-link :to="'/detail/'+item.goods_id">
                <van-card :price="item.goods_price" :title="item.goods_name"
                    :thumb="item.goods_big_logo ? item.goods_big_logo : 'https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg'" />
            </router-link>
        </div>

    </div>
</template>

<script setup>
import router from '@/router';

const onClickLeft = () => {
    router.push('/')
}
import { goodsApi } from '@/api/api';
import { useRoute } from 'vue-router';
import { ref } from 'vue';
let route = useRoute()
let goodsApiData = ref([])
goodsApi(route.params.query).then(res => {
    console.log(res);
    goodsApiData.value = res.data.message.goods

})
</script>

<style lang="scss" scoped></style>